import * as fs from 'fs';
import * as path from 'path';
export const getMailCodeTemplate = (type: string, code: number | string): Promise<string> => {
    return new Promise((resolve, reject) => {
        fs.readFile(path.join(__dirname, '../../public/template/mailCode.html'), (err, data) => {
            if (err) return reject(err);
            const result = Buffer.from(data).toString().replace('[type]', type).replace('[code]', String(code));
            resolve(result);
        });
    });
};
